
import requests
from config.parseconfig import ConfigHandler
conf = ConfigHandler()
data = conf.parse_json()


class BaseToken:
    def __init__(self,SECRET):
        params = {
            'corpid':data['compid'],
            "corpsecret": SECRET
        }
        r = requests.get('https://qyapi.weixin.qq.com/cgi-bin/gettoken', params=params)
        print(r.json())
        self.token = r.json()['access_token']
